package com.jk.bgmainconsumer.service;

import com.jk.damaicommon.entity.TicketEntity;
import com.jk.bgmainconsumer.entity.UserEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @title
 * @description
 * @author 赵优秀
 * @updateTime 2021/9/1 12:17
 * @throws
 */

@Component
@FeignClient("bguserprovider")
public interface UserService {
    /**
     * @title
     * @description
     * @author 赵优秀
     * @updateTime 2021/9/2 9:17
     * @throws
     */
    //查询
    @GetMapping(value = "/user/findUser")
    List<UserEntity> findUser(@SpringQueryMap UserEntity userEntity);
    //批量删除
    @RequestMapping("/user/delAll")
    void delAll(@RequestParam String ids);
    //批量冻结
    @RequestMapping("/user/freezeAll")
    void freezeAll(@RequestParam String ids);
    //逻辑单删
    @RequestMapping("/user/del")
    void del(@RequestParam Integer id);
    //冻结
    @RequestMapping("/user/freezeUser")
    void freezeUser(@RequestParam Integer id);
    //解冻
    @RequestMapping("/user/UnFreezeUser")
    void UnFreezeUser(@RequestParam Integer id);
    //回显
    @RequestMapping("/user/getByid")
    UserEntity getByid(@RequestParam Integer id);
    //修改
    @PostMapping(value = "/user/updateUser")
    void updateUser(@RequestBody UserEntity userEntity);
    //查询冻结
    @GetMapping(value = "/user/findFreezeUser")
    List<UserEntity> findFreezeUser(@SpringQueryMap UserEntity userEntity);
    //查询删除用户
    @GetMapping("/user/findDelUser")
    List<UserEntity> findDelUser(@SpringQueryMap UserEntity userEntity);
    //恢复用户
    @RequestMapping("/user/onUser")
    void onUser(@RequestParam Integer id);
    //批量结冻
    @RequestMapping("/user/onFreezeAll")
    void onFreezeAll(@RequestParam String ids);
    //查询优惠券数量
    @RequestMapping("/user/findCoupon")
    List<UserEntity> findCoupon();
    //查询拥有的优惠券
    @RequestMapping("/user/grantCoupon")
    List<TicketEntity> grantCoupon();
    //发放优惠券
    @PostMapping(value = "/user/grant")
    String grant(@RequestBody TicketEntity ticket);
    @RequestMapping("/user/userCoupon")
    List<TicketEntity> userCoupon(@RequestParam("id") Integer id);
}
